<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/static/js/echarts.min.js"></script>
</head>
<body>
<div id="main" style="width:900px;height: 700px;margin: 0 auto"></div>


<script>
    var data_city = [{% for r in rs_gamc %} "{{r.city}}", {% endfor %}];
    var data_avg_money = [{% for r in rs_gamc %} {{ r.avg_money }}, {% endfor %}];
    //  基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById("main"));

    // 指定图表的配置项和数据
    var option = {
        title: {
            text: 'Echarts 入门演示'
        }
        , tooltip: {}
        , legend: {
            data: ["城市"]
        }
        , xAxis: {
            data: data_city
        }
        , yAxis: {}
        , series: [{
            name: '人均收入',
            type: 'bar',
            data: data_avg_money
        }]
    };
    myChart.setOption(option);
</script>

</body>
</html>